<?php
@header("content-type:text/html;charset=utf-8");

@include_once("conn.php");
@include_once("common.php");//和 mysql数据库建立连接

// $user = $_POST["user"];
$pwd = $_POST["pwd"];
$phone = $_POST["phone"];
// $email = $_POST["email"];
if(!($phone)){
    paramsErr();
}
// $sql="insert into `userinfo` (user,pwd,phone,email) values('$user','$pwd','$phone','$email')";
$sql="insert into `userinfo` (pwd,phone) values('$pwd','$phone')";
$bool = mysqli_query($conn,$sql);
if(!$bool){
    $obj=array();
    $obj["status"]=false;
    $obj["detail"]="sql语句执行错误";
    $obj["sql"]=$sql;
    exit(json_encode($obj)) ;
}
$rows = mysqli_affected_rows($conn);
$obj=array();
if($rows>0){
    $obj["status"]=true;
    $obj["detail"]="注册成功";
}
echo json_encode($obj);


?>